<?php
class TestControl extends CControl
{
    function __construct()
    {
	    parent::__construct(0);
//            require_once LIB.'/alipay/alipay/pagepay/service/AlipayTradeService.php';
    }
    
    public function indexAction()
    {
        $num = 2.30;
        $num = ConstModel::baoliufloat($num);
        echo $num;
    }

    public function testAction()
    {
        $a = array();
        $a[1] = array();
        $a[2] = array();
        $a[1] = array();
        if($a[1])
        {
            echo '有内容';
        }else
        {
            echo '没有内容';
        }
    }
    public function pullAction()
    {
        $this->display();
        
    }
    
    public function insert20Action()
    {
        DBData::setSqlDebug();
        $uid1 = 58459; //137人
        $uid2 = 58461; //293人

//        $sql = "select id from web_user where isforbidden = 1 order by id asc limit 294,1";
//        $arrList = DBData::selectlist($sql);
//        foreach($arrList as $arr)
//        {
//            $uid = $arr['id'];
//            $tab = "lzh_user_relation";
//            $data = array('f_uid'=>$uid1);
//            $where = "uid = '$uid'";
//            DBData::uptable($data, $where, $tab);
//        }
//        $sql = "select id from web_user where isforbidden = 1 order by id asc limit 550,5";
//        $arrList = DBData::selectlist($sql);
//        foreach($arrList as $arr)
//        {
//            $uid = $arr['id'];
//            $tab = "lzh_user_relation";
//            $data = array('f_uid'=>$uid2);
//            $where = "uid = '$uid'";
//            DBData::uptable($data, $where, $tab);
//        }
    }
    
    
    public function newactAction()
    {
        DBData::setSqlDebug();
        $uid = 8205;
        $reback = IntegralModel::actintegral($uid);
        var_dump($reback);
    }
    
    public function wxorderAction()
    {
        $data['appid'] = 'wx0378cccf4439e0ca';
        $data['mch_id'] = '1401060302';
        $data['transaction_id'] = '4200000495202003310219421704';
        $data['nonce_str'] = strtoupper(md5(time().rand(0,1000)));
        $key = 'qeg892hkdhJJ9K73hdbxg293749ahb3s';
        $sign = WeixinpayModel::getsign($data, $key);
        echo $sign;
        $data['sign'] = $sign;
        $url = 'https://api.mch.weixin.qq.com/pay/orderquery';
        $xml = WeixinpayModel::getxml($data);
        $res = curlModel::getcurl($url, $xml);
        $ob= simplexml_load_string($res,'SimpleXMLElement', LIBXML_NOCDATA);//将字符串转化为变量
        var_dump($ob); echo "<hr>";
        $res = json_encode($ob);
        $resArr = json_decode($res,true);
        var_dump($resArr);
        echo "<hr>";
        $dd['appid'] = 'wx0378cccf4439e0ca';
        $dd['bank_type'] = 'OTHERS';
        $dd['cash_fee'] = '385';
        $dd['device_info'] = 'act:igshop,mainid:6174';
        $dd['fee_type'] = 'CNY';
        $dd['is_subscribe'] = 'N';
        $dd['mch_id'] = '1401060302';
        $dd['nonce_str'] = '4639475d6782a08c1e964f9a4329a254';
        $dd['openid'] = 'ob1_Fw4QNOenuuOp_5-ZEl67QmSw';
        $dd['out_trade_no'] = 'IN20200331223153904376';
        $dd['result_code'] = 'SUCCESS';
        $dd['return_code'] = 'SUCCESS';
        $dd['time_end'] = '20200331223216';
        $dd['total_fee'] = '385';
        $dd['trade_type'] = 'APP';
        $dd['transaction_id'] = '4200000495202003310219421704';
        
        $sign = WeixinpayModel::getsign($dd, $key);

        echo $sign;
        
        
    }
    public function aliorderAction()
    {
        $M = new AliPay2Model();
        
        $reback = $M->query("","2020040622001482201409535153");
        var_dump($reback);
    }
    
    public function findorderAction()
    {
        $config = array(
            'appid' =>'2018112462327447',//商户密钥
            'rsaPrivateKey' =>'MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDKw/B5+/0HjBl2dkxAoxoyCI7ZW6ilQKoCZV5FNqa1Y5aC/+2Yj1JbyUkU5QaPP1ejfRLRDIg8upiyZyn6KlHkmXN9pxny21Ae161EryPy6DwqsF+WCltgsHCkuA5PeZVeKbQYlhR+nHdIInvkPdMb5iMamPYkfY3SyRXeK63m/eCsIlQus1PD3M2HvLnW7P0reQqAJm1ZvE3h3U8FYEYqEowVEkWUtUcPfdRepoVMkQ74Vkf/U9WvlgblLfxdPYzFQw24T6QrLpVYFxJAjqBJH+7upOmZeVJk/ROaDVQz6SgXknxcCFNq98kVtFNvN2k0LWSAdfAxCI7OxiKhznBdAgMBAAECggEBAJiTdookHxOlzadBf0G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mD5Mee3a2X+sXoeb4/mfeavnS3su1isvVVJh8bERLJweQXDsG8aAteRsbRYoL1lXxpSXA/+0Tr0fr1VwIDAQAB',//公钥
            'charset'=>strtolower('utf-8'),//编码
            //'notify_url' =>'http://app.syxhn.cn/appapi/chongalipayrc',//回调地址(支付宝支付成功后回调修改订单状态的地址)
            'notify_url' =>'http://houtai.syxhn.cn/ali/appnotifyurl',//回调地址(支付宝支付成功后回调修改订单状态的地址)
            'payment_type' =>1,//(固定值)
            'seller_id' =>'',//收款商家账号
            'charset'    => 'utf-8',//编码
            'sign_type' => 'RSA2',//签名方式
            'timestamp' =>date("Y-m-d H:i:s"),
            'version'   =>"1.0",//固定值
            'url'       => 'https://openapi.alipay.com/gateway.do',//固定值
            'method'    => 'alipay.trade.app.pay',//固定值
        );
        //require_once (ROOT."/lib/alipay/alipay/config.php");

        require_once (ROOT."/lib/alipay-sdk-PHP-4.6.0/aop/AopClient.php");
        require_once (ROOT."/lib/alipay-sdk-PHP-4.6.0/aop/request/AlipayTradeQueryRequest.php");
        $aop = new AopClient();
        $aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
        $aop->appId = '2018112462327447';
        $aop->rsaPrivateKey = 'MIIEpQIBAAKCAQEA2BLBWQoj7aqhw9ccwUnkRiL8yb7WOJAEOvdVvJAV4r8w5SpvPxn8yTEVRh+JpSq3YrV9uekdc4qUGHwLpC+A+J9x23iUm8X6Rtwwu4bZ3h6sEmKRnNh3F9dKxb/TgekMpm087RxedK+APJAJa8xzUAbqJDmcojJrrWzCsxmdTvV7j3iclKO/twiq9YJWW4mMBM9THfc60acec7pHpEvK9jzN1P1P2rcBT+kAD9Yu8uf0pOrKgpW44TpmTFf3ruqvV/qeYzkIXUK+PkWAtGyiAKRhCrKEwIUQZ+58xY7CXDI1qY8jKKCpNl/H4heO0GsJF4fQ+bM3uZH+CO7HpK90kQIDAQABAoIBAQCBM5XRvDKHpwRbqoFTQu/w0HL/39EQuW0OJV9rBW1QzKpcHeevf8ac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YxicXuwsHy4beFYrotOblwWlbEdGaNjtz/Tco2KmCrGgEdHOZsHiAfxc+uzgqKPZWQy7K5beS8tBOZiF96FoU2lDUE=';
        $aop->apiVersion = '1.0';
        $aop->signType = 'RSA2';
        $aop->postCharset = 'UTF-8'; //'GBK';
        $aop->format='json';
        $request = new AlipayTradeQueryRequest();
        $data = array('trade_no'=>'2020040622001482201409535153');
        $request->setBizContent(json_encode($data));
        $result = $aop->execute($request); 
        
        $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
        $resultCode = $result->$responseNode->code;
        if(!empty($resultCode)&&$resultCode == 10000){
            //echo "成功";
        } else {
            //echo "失败";
        }
    }
    public function wxfindorderAction()
    {
        //判断订单号是否是微信里存在的
        $wxdata['appid'] = 'wx0378cccf4439e0ca';
        $wxdata['mch_id'] = '1401060302';
//        $wxdata['transaction_id'] = '4200000551202006027560250310';
        $wxdata['out_trade_no'] = '15911060399968';
        $wxdata['nonce_str'] = strtoupper(md5(time().rand(0,1000)));
        $key = 'qeg892hkdhJJ9K73hdbxg293749ahb3s';
        $_sign = WeixinpayModel::getsign($wxdata, $key); 
        $wxdata['sign'] = $_sign;
        $url = 'https://api.mch.weixin.qq.com/pay/orderquery';
        $xml = WeixinpayModel::getxml($wxdata);
        $res = curlModel::getcurl($url, $xml);
        $ob= simplexml_load_string($res,'SimpleXMLElement', LIBXML_NOCDATA);//将字符串转化为变量 
        $res = json_encode($ob);
        $resArr = json_decode($res,true);
        var_dump($resArr);
            //-------判断完毕
    }
    public function weekAction()
    {
        $index = date("w"); 
        echo $index;
    }
    
    
    public function tmprelaAction()
    {
        DBData::setSqlDebug();
        $uid1 = 40902;
        $touid = 74581; //2020-02-06 18:13:01 这个时间注册的
        $time = '2020-02-07 11:13:01';
        $inttime = strtotime($time);
        $sql = "select * from lzh_user_relation where f_uid = '$uid1' order by uid asc limit 0,105";
        $arrList = DBData::selectlist($sql);
        foreach($arrList as $key=>$arr)
        {
            $inttime1 = $inttime + $key;
            $inttime2 = $inttime1 + (86400*3);
            $uid = $arr['uid']; 
            $data = array('f_uid'=>$touid,'rela_line'=>$touid.','.$uid);
            DBData::uptable($data, "uid='$uid'", "lzh_user_relation");
            $data2 = array("f_uid"=>$touid,'add_time'=>$inttime1,'uptime'=>$inttime2,'sign_total'=>3,'is_goback_zc'=>1);
            DBData::uptable($data2, "id='$uid'", "web_user");
        }
    }
    
    public function jianfaAction()
    {
        $data = array('a'=>'b','b'=>4);
        $a = '5';
        $data2 = array('c'=>'ss',"d = d+{$a}");
        $where = "id= 4";
        $tab = 'test';
        $data = array_merge($data, $data2);
        $sql = DBData::upsql($data, $where, $tab);
        echo $sql;
    }
    //3,2,1的补分
    public function bufenAction()
    {
        $start_time = 1585238400;
        $end_time = 1585670399;
        
    }
    public function getAction()
    {
        $a = '10.1.1';
        $b = '2.0.11';
        if($b > $a)
        {
            echo "b大";
        }else
        {
            echo "a大";
        }
        echo "<hr>";
        echo strcmp($a,$b);
        echo "<hr>";
        $_phone = '12345678901';
        $_phone = substr_replace($_phone, '*****', 3, 5);
        echo $_phone;
    }
    
    public function tklAction()
    {
        $str = '6KaG572u6L+Z6KGM6K+d4oKkOFJ0UDE3ZFNNMWbigqTovaznp7voh7PPhNCwb+WundCwz4HPgeOAkOebm+S6rOakjeadkOm5heWNteefs+WkqeeEtuWwj+efs+WktOmbqOiKseefs+eZveiJsuWwj+eZveefs+WtkOiKseebhuagveWkmuiCieijhemlsOmTuumdouOAke+8m+aIlmh0dHBzOi8vbS50Yi5jbi9oLlY0SE5nUWQ/c209ZjA2Y2JiIOm7nuWHu+mPiOKGkuaOpe+8jOWGjemAieaLqeeAjy4u6Ka9Li7lmZDlpKflvIA=';
        $str2 = 'ImZ15qSN6L+Z6KGM6K+d4oKkU1NqUzFrVEx5am7igqTovaznp7voh7Pwn5GJz4TQsG/lrp3QsM+Bz4Hwn5GI44CQ6Ziy6L6Q5bCE6L+R6KeG55y86ZWc55S35oqX6JOd5YWJ5aWz5bmz5YWJ55ay5Yqz55yL5omL5py655S16ISR5peg5bqm5pWw5LiT55So5L+d5oqk55y8552b44CR77yb5oiWaHR0cHM6Ly9tLnRiLmNuL2guVjZ2MFlIcD9zbT01OWFjZjcg6bue5Ye76Y+I4oaS5o6l77yM5YaN6YCJ5oup54CPLi7opr0uLuWZkOWkp+W8gCI=';
        $keyword = '6KaG572u6L+Z6KGM6K+dwqI0TmVDMUpKRDZqWsKi5omT5byA5reY5a6d5oiW54K55Yeg6ZO+6KGXaHR0cHM6Ly9tLnRiLmNuL2guVlA5TTB3ZD9zbT05OTJlOTcg6Iez54CPbGFu5ZiCLi7jgJDnlLXohJHpmLLovpDlsITkv53miqTlsY/ohpznrJTorrDmnKzlj7DlvI/mnLrmmL7npLrlmajlsY/luZXmiqTnnLzlrZXlpofpmLLok53lhYnkv53miqTlsY/jgJE=';
        $keyword = '57eu572u6L+Z5q616K+dJGhibE0xSXhIcTlyJOaJk+alt+a3mOWuneaIluaOguWHu+mPiOKGkuaOpWh0dHBzOi8vbS50Yi5jbi9oLlZtOEFnUkY/c209OGU3ZmZiIOiHs+eAjy4u6Ka9Li7lmZDjgJDov5nkuKoj6IGa5YiS566X5Zui6LStI+Wunei0neS4jemUmTrmrKfojrHpm4Xpu5Hnsr7ljY7mipfogIHntKfoh7TooaXmsLTkv53mub/pnaLpg6jnsr7ljY7mtrLmj5Dkuq7ogqToibLogozlupXmtrLmraPlk4E1MG1sKOWIhuS6q+iHqkDmiYvmnLrmt5jlrp1hbmRyb2lk5a6i5oi356uvKeOAkQ==';
        $res = ItaokeModel::find($keyword);
        var_dump($res); 
    }
    
    public function crelogAction()
    {
        $D = new record_user_logData();
        $D->create(date("Ym"));
    }
    
    public function layerAction()
    {
        $str = '{"id":"4","is":"yes"}';
        
        $arr = json_decode($str,true);
        var_dump($arr);
    }
    public function crawlAction()
    {
        DBData::setSqlDebug();
        $page = (int)$this->_getParam('page');
        if(empty($page))
        {
            $page = 1;
        }
        $end_page = 10;
        $pagesizes = 100;
        echo $page ; echo "<hr>";
        if($page <= $end_page)
        {
            TaobaoModel::crawl($page, "", "30,1801", 1, $pagesizes);
        }
    }
    public function crawl2Action()
    {
        DBData::setSqlDebug();
        TaobaoModel::crawl_material("30443", 1, 100);
    }
    
    public function ttAction()
    {
        $key = '6KaG572u6L+Z6KGM6K+d4oKzWlJPQTFvNlR1MVjigrPmiZPlvIDwn5GJ8J+NkeWunfCfkYjmiJbmjoLlh7vpj4jihpLmjqVodHRwczovL20udGIuY24vaC5WUTc0WXJkP3NtPTRkY2ZlOCDoh7PngI8uLuimvS4u5ZmQ44CQQU5FU1NBL+WuieeDreaymeWwj+mHkeeTtumYsuaZkumcnOWls+mdoumDqOi6q+S9kzYwbWxTUEY1MCvnlLflpbPpmLLmmZLjgJE=';
        $a = ItaokeModel::find($key);
        var_dump($a);
        echo "<hr>";
        $key = '5aSN5Yi26L+Z6KGM6K+d4oKzM0lLSDFvTkFPZmrigrPmiZPlvIDwn5GJ5reY5a6d8J+RiOaIlueCueWHoOmTvuihl2h0dHBzOi8vbS50Yi5jbi9oLlZqUjY0Rmg/c209MGQ5MWNlIOiHs+eAjy4u6Ka9Li7lmZDjgJDlhL/nq6XoioLnjqnlhbfnpLznianmvKvlqIFjb3NwbGF5576O5Zu96Zif6ZW/5oqr6aOO6YGT5YW35aOw5YWJ5YmR55u+54mM5q2m5Zmo5pyN6KOF44CR ';
        $a = ItaokeModel::find($key);
        var_dump($a);
        
    }
    public function csAction()
    {
        $date = '2018-02-08';
        $t = date('Y-m-t 23:59:59',strtotime($date));
        echo strtotime($t);echo "<hr>";
        echo $t;
        echo "<hr>";
        $this->cs('a','bb');
    }
    public function cs()
    {
        $a = func_get_args();
        var_dump($a);
    }
    public function shellAction()
    {
        $page = (int)$this->_getParam('page');
        if($page <=10)
        {
            echo 'ok';
        }else
        {
            echo 'fails';
        } 
    }
    
    public function rewardAction()
    {
        DBData::setSqlDebug();
        $uid = 8675;
        $reback = RewardModel::succ($uid);
        var_dump($reback);
    }
    
    public function gfAction()
    {
        DBData::setSqlDebug();
        $uid = 901;
        $uid = 1198;
        $s = IntegralModel::actintegral202005($uid);
        var_dump($s);
    }
    public function daysAction()
    {
//        DBData::setSqlDebug();
//        $uid = 8675;
//        RewardModel::succ($uid);
        DBData::setSqlDebug();
        $timer = time();
        $days = date("Ymd",$timer);
        $inttime1 = strtotime($days);
        $inttime2 = $inttime1 + 86400 - 1;
        $where = "days = '$days' and state = 1";
        $D = new dayrewardData();
        $integrallogD = new integrallogData();
        $moneylogD = new moneylogData();
        $funcamountlogD = new func_amount_logData();
        $arrList = $D->RecordList("id,uid,integral,limit_withdraw,func_amount,money", $where, $D->tablename);
        $baseconfig = getconfig('base');
        $integral_transrate = $baseconfig['integral_transrate']['other'];
        foreach($arrList as $arr)
        {
            $uid = $arr['uid'];
            $integral = (float)$arr['integral'];
            $func_amount = (float)$$arr['func_amount'];
            $money = (float)$arr['money'];
            $limit_withdraw = (float)$arr['limit_withdraw'];
            $whe = "uid='$uid' and tp= 80 and add_time between {$inttime1} and {$inttime2}";
            $arrInfo = $moneylogD->Record("act_money", $whe, $moneylogD->tablename);
            var_dump($arrInfo); echo "\r\n";
            if(!$arrInfo)
            {
                //说明先签到了，没有获得积分
                $addArr = array(
                    'money'=>$money,'integral'=>$integral,'func_amount'=>$func_amount,'limit_withdraw'=>$limit_withdraw
                );
                var_dump($addArr);
                $reback = RewardModel::resethandle($uid, $days, $addArr);
                var_dump($reback);
            }else
            {
                $act_money = $arrInfo['act_money'];//已经给了的活跃金

                $integrallogInfo = $integrallogD->Record("act_integral", "uid='$uid' and type_num = 80 and add_time between {$inttime1} and {$inttime2}", $integrallogD->tablename);
                $act_integral = $integrallogInfo?$integrallogInfo['act_integral']:0 ;  //已经给了的积分

                $funcamountlogInfo = $funcamountlogD->Record("act_amount", "uid='$uid' and add_time between {$inttime1} and {$inttime2} and types = 80 ", $funcamountlogD->tablename);
                $act_amount = $funcamountlogInfo?$funcamountlogInfo['act_amount']:0 ; //已经给了的红包

                $cha_integral = $integral - (float)$act_integral;
                $_limit = $cha_integral * $integral_transrate;

                $addArr = array(
                    'money'=>$money - $act_money,
                    'integral'=>$cha_integral,
                    'func_amount'=>$func_amount - $act_amount,
                    'limit_withdraw'=>$_limit
                );
                RewardModel::resethandle($uid, $days, $addArr);
            }
        }
        
    }
    public function timeAction()
    {
        $start_day = '2020-06-01 00:00:00';
        $start_time = strtotime($start_day);
        for($i=1;$i<=108;$i++)
        {
            $t = $i * 20 * 60; 
            $end_time = $start_time + $t;
            $s_time = $end_time - 20*60;
            
            $end_day = date("Y-m-d H:i:s",$end_time);
            $time1 = date("Y-m-d H:i:s",$s_time);
            echo $time1;
            echo '----';
            echo $end_day;
            echo '<a href="/sysadminz/sysindex.php?c=taobao&a=tborder&time1='.$time1.'&time2='.$end_day.'&OrderScene=2&query_type=1" target="_blank">订单抓取1</a>';
            echo '----';
            echo '<a href="/sysadminz/sysindex.php?c=taobao&a=tborder&time1='.$time1.'&time2='.$end_day.'&OrderScene=2&query_type=3" target="_blank">订单判断3</a>';
            echo "<br>";
           
        }
    }
    //淘宝订单佣金过千：因为按照产品的前台订单来同步
    public function resettaobaoAction()
    {
        DBData::setSqlDebug();
        $tab ='taobao_order';
        $sql = "select id,tk_total_rate,alipay_total_price,total_commission_rate,commission_total,commission from taobao_order where total_commission_rate > 100 order by total_commission_rate desc limit 50";
        $arrList = DBData::selectlist($sql);
        var_dump($arrList); 
        exit();
        foreach($arrList as $arr)
        {
            $id = $arr['id'];
            $total_commission_rate =(float)$arr['total_commission_rate'];
            $total_commission_rate = $total_commission_rate / 100;
            $commission_total = (float)$arr['commission_total'];
            $commission_total = $commission_total / 100;
            $data = array('total_commission_rate'=>$total_commission_rate,'commission_total'=>$commission_total);
            DBData::uptable($data, "id='$id'", $tab);
        }
    }
    
    //群主的等级设置
    public function dengjisetAction()
    {
        DBData::setSqlDebug();
        $sql = "select id,phone,dengji from web_user where daili = 2 and dengji = 5";
        $arrList = DBData::selectlist($sql);
        var_dump($arrList);
    }
    
    //重新签到
    public function resetdrawAction()
    {
        DBData::setSqlDebug();
        $timer = time();
        $rewardD = new dayrewardData();
        $userD = new web_userData();
        $integralD = new integralData();
        $integrallogD = new integrallogData();
        $moneyD = new moneyData();
        $moneylogD = new moneylogData();
        $funcamountlogD = new func_amount_logData();
        ///半夜执行完在重新计算下：一定是要在执行完毕了计算的定时任务后才能执行
        $days = '20200609';
        $sql = "select * from dayreward where uid in (
select uid from x_user_moneylog where tp= 80 and add_time between 1591632000 and  1591637820 order by id desc
) and days = '20200609'  ";
        
        $arrList = DBData::selectlist($sql);///在0点到1:37之间签到完毕的了，在重新的处理下
        
        var_dump($arrList);  echo "<hr>\r\n";
        $baseconfig = getconfig('base');
        $integral_transrate = $baseconfig['integral_transrate']['other'];
        $inttime1 = 1591632000;
        $inttime2 = $inttime1 + 86400;
        foreach($arrList as $arr)
        {
            $uid = $arr['uid'];
            $integral = (float)$arr['integral'];
            $func_amount = (float)$arr['func_amount'];
            $money = (float)$arr['money'];
            $limit_withdraw = (float)$arr['limit_withdraw'];
            $whe = "uid='$uid' and tp= 80 and add_time between {$inttime1} and {$inttime2}";
            $arrInfo = $moneylogD->Record("act_money", $whe, $moneylogD->tablename);
            if(!$arrInfo)
            {
                //说明先签到了，没有获得积分
                $addArr = array(
                    'money'=>$money,'integral'=>$integral,'func_amount'=>$func_amount,'limit_withdraw'=>$limit_withdraw
                );
                RewardModel::resethandle($uid, $days, $addArr);
            }else
            {
                $act_money = $arrInfo['act_money'];//已经给了的活跃金

                $integrallogInfo = $integrallogD->Record("act_integral", "uid='$uid' and type_num = 80 and add_time between {$inttime1} and {$inttime2}", $integrallogD->tablename);
                $act_integral = $integrallogInfo?$integrallogInfo['act_integral']:0 ;  //已经给了的积分

                $funcamountlogInfo = $funcamountlogD->Record("act_amount", "uid='$uid' and add_time between {$inttime1} and {$inttime2} and types = 80 ", $funcamountlogD->tablename);
                $act_amount = $funcamountlogInfo?$funcamountlogInfo['act_amount']:0 ; //已经给了的红包

                $cha_integral = $integral - (float)$act_integral;
                $_limit = $cha_integral * $integral_transrate;

                $addArr = array(
                    'money'=>$money - $act_money,
                    'integral'=>$cha_integral,
                    'func_amount'=>$func_amount - $act_amount,
                    'limit_withdraw'=>$_limit
                );
                RewardModel::resethandle($uid, $days, $addArr);
            }
            echo "<hr>\r\n";
        }  
    }
    
    //补发7号的积分
    public function bufaxhncouponAction()
    {
        $sql = "select sum(act_integral) sum,uid from user_integral_log_tmp_202006 where  add_time between 1591459200 and 1591545599  group by uid order by sum desc";
        $arrList = DBData::selectlist($sql);
        foreach($arrList as $arr)
        {
            $sumintegral = $arr['sum'];
            $uid = $arr['uid'];
            
        }
    }
    
    public function bukoucouponAction()
    {
        exit();
        DBData::setSqlDebug();
        $coupon_integral = 501.32;
        $logid = $this->get('logid');
        $xhnlogD = new x_user_xhncouponlogData();
        //先判断下是不是有的过了的
        $pdInfo = $xhnlogD->Record("id", "from_act='xhnlog_id:{$logid}'",$xhnlogD->tablename);
        if($pdInfo)
        {
            echo '已经有这个记录了';echo "<hr>";
            return false;
        } else {
            echo '没有xhnlog_id:'.$logid;echo "<hr>";
        }
        $logInfo = $xhnlogD->Record("*", "id='$logid'", $xhnlogD->tablename);
        var_dump($logInfo); echo "<hr>";
        $num = (int)$logInfo['num'];
        $uid = (int)$logInfo['uid'];
        $cut_integral = $coupon_integral * $num; //一共需要的减少的积分
        echo '一共需要积分：'.$cut_integral; echo "<hr>";
        $integralD = new integralData();
        $integrallogD = new integrallogData();
        $integralInfo = $integralD->getInfo($uid);
        $integral = $integralInfo['integral'];
        echo '会员‘'.$uid.'’有积分：'.$integral;echo "<hr>";
        if($integral >= $cut_integral)
        {
            $integralInfo = $integralD->add_integral($integralInfo, -$cut_integral);
            $timer = time();
            $integrallogArr = array(
                'uid'=>$uid,'act_integral'=>-$cut_integral,'add_time'=>$timer,'bz'=>'积分兑换排行榜牛金卷[补8日兑换]',
                'type_num'=>30,'from_ader_id'=>0,'from_order_id'=>0,'taobao_orderid'=>0,'bs_uid'=>0,'from_act'=>'xhnlog_id:'.$logid
            );
            $integrallogArr = array_merge($integrallogArr, $integralInfo);
            $integrallogD->intotable($integrallogArr, $integrallogD->tablename);
            $integralD->_up($integralInfo);
        }else
        {
            echo '可惜积分不足';
        }
    }
    
    //给7号补分
    public function bufen7haoAction()
    {
        DBData::setSqlDebug();
        $timer = time();
        $integralD = new integralData();
        $integrallogD = new integrallogData();
        $sql = "select sum(act_integral) sum_integral,uid from user_integral_log_tmp_202006 where   add_time between 1591459200 and 1591545599 group by uid";
        $arrList = DBData::selectlist($sql);
        foreach($arrList as $arr)
        {
            $sum_integral = (float)$arr['sum_integral'];
            $uid = (int)$arr['uid'];
            //判断7号签到了没
            $sql3 = "select act_integral from dayreward where uid = '$uid' and days = '20200607'";
            $dayInfo = DBData::select($sql3);
            $_fen = $dayInfo['act_integral'];
            if($_fen < 12)
            {
                continue;
            }
            if($uid == 7112)
            {
                continue;
            }
            //判断7号给了没
            $sql2 = "select sum(act_integral) sumjifen from user_integral_log where  uid = '$uid' and add_time between 1591459200 and 1591545599  and type_num = 80";
            $arrInfo = DBData::select($sql2);
            if($arrInfo)
            {
                //说明给了，在判断下给的全不全
                $sumjifen = (float)$arrInfo['sumjifen'];
                $cha = $sum_integral - $sumjifen;
                if($cha > 0)
                {
                    //说明要补下的
                    $integralInfo = $integralD->getInfo($uid);
                    $integralInfo = $integralD->add_integral($integralInfo,$cha);
                    $integrallogArr = array(
                        'uid'=>$uid,'act_integral'=>$cha,'add_time'=>$timer,'bz'=>'激活并获取7日流量',
                        'type_num'=>80,'from_ader_id'=>0,'from_order_id'=>0,'taobao_orderid'=>0,'bs_uid'=>0,'from_act'=>'-'
                    );
                    $integrallogArr = array_merge($integrallogArr, $integralInfo);
                    $integrallogD->intotable($integrallogArr, $integrallogD->tablename);
                    $integralD->_up($integralInfo);
                }
            }else
            {
                //直接就给
                $integralInfo = $integralD->getInfo($uid);
                $integralInfo = $integralD->add_integral($integralInfo,$sum_integral);
                $integrallogArr = array(
                    'uid'=>$uid,'act_integral'=>$sum_integral,'add_time'=>$timer,'bz'=>'激活并获取7日流量',
                    'type_num'=>80,'from_ader_id'=>0,'from_order_id'=>0,'taobao_orderid'=>0,'bs_uid'=>0,'from_act'=>'-'
                );
                $integrallogArr = array_merge($integrallogArr, $integralInfo);
                $integrallogD->intotable($integrallogArr, $integrallogD->tablename);
                $integralD->_up($integralInfo);
            }
        }
    }
    
    public function backfenAction()
    {
        DBData::setSqlDebug();
        $uid = 11763;
        $M = new IntegralModel();
        $reback = $M->reggobacknew202008($uid);
        var_dump($reback);
    }
    public function relaAction()
    {
        $rela_line = '1,2,3,4,5,67,89,10,11';
        $daili_line = '1,2,2,1,2,2,2,2,1';
        $relaD = new lzh_user_relationData();
        $data = $relaD->handleline($rela_line,$daili_line);
        var_dump($data);
    }
    
//    public function jinyongAction()
//    {
//         
//        $userD = new web_userData();
//        $where = "isforbidden = 1";
//        $arrList = $userD -> RecordList("id,phone,money,cash_money,integral,xhn_coupon_num", $where, $userD->tablename, "order by id asc");
//        
//        $ExlM = new ExportExcelModel(); 
//        $excelHead = "禁用名单";
//        $sortArr = array(
//            array('txt'=>'ID','fields'=>'id','width'=>'70'),
//            array('txt'=>'电话','fields'=>'phone','width'=>'120'),
//            array('txt'=>'活跃金','fields'=>'money','width'=>'100'), 
//            array('txt'=>'现金余额','fields'=>'cash_money','width'=>'120'), 
//            array('txt'=>'已有积分','fields'=>'integral','width'=>'120'),
//            array('txt'=>'牛金卷个数','fields'=>'xhn_coupon_num','width'=>'120'), 
//        );
//        $headtitle= "<tr><td  colspan='".count($sortArr)."' >{$excelHead}</td></tr>"; 
//        $filename = "reimbursement.xls";             
//        $ExlM->excelData2($arrList,$sortArr,$headtitle,$filename); 
//    }
//    public function jinyong2Action()
//    {
//        DBData::setSqlDebug();
//        $userD = new web_userData();
//        $where = "isforbidden = 1";
//        $arrList = $userD -> RecordList("id,phone,money,cash_money,integral,xhn_coupon_num", $where, $userD->tablename, "order by id asc");
//        $moneyD = new moneyData();
//        $integralD = new integralData();
//        foreach($arrList as $arr)
//        {
//            $id = $arr['id'];
//            $data1 = array(
//                'money'=>0,'cash_money'=>0,'integral'=>0,'xhn_coupon_num'=>0
//            );
//            $whe1 = "id='$id'";
//            $userD -> uptable($data1, $whe1, $userD);
//            
//            //清空金额表
//            $data2 = array('money'=>0,'cash_money'=>0);
//            $whe2 = "uid = '$id'";
//            $moneyD-> uptable($data2, $whe2, $moneyD);
//            
//            //清空积分
//            $data3 = array('integral'=>0);
//            $whe3 = "uid = '$id'";
//            $integralD ->uptable($data3, $whe3, $integralD);
//            
//        }
//    }
//    
//    public function qunzhuAction()
//    {
//        exit();
//        $userD = new web_userData();
//        DBData::setSqlDebug();
//        $where = "dengji in (7,8)";
////        $fields = "id,phone,dengji,money,limit_withdraw";
////        $extra = "order by dengji asc";
//        $data = array("limit_withdraw = limit_withdraw + 1200");
//        $userD->uptable($data, $where, $userD);
////        $arrList = $userD->RecordList($fields, $where, $userD, $extra);
////        foreach($arrList as $arr)
////        {
////            $str = implode("====",$arr);
////            echo $str; echo "<br>";
////        }
//        
//    }
    
    public function initrelaAction()
    {
        DBData::setSqlDebug();
        $userD = new web_userData();
        $relaD = new lzh_user_relationData();
        $where = "num > 90";
        $extra = "order by uid asc";
        $relaList = $relaD::RecordList("uid,rela_line,daili_line",$where,$relaD->tablename,$extra,1,50);
        foreach($relaList as $arr)
        {
            $uid = $arr['uid'];
            $data = $userD->rela_line($uid,"","",$relaD);
            var_dump($data); 
            $whe = "uid='{$uid}'";
            $relaD::uptable($data,$whe,$relaD);
            echo '<hr>';
        }
    }
    public function editrelaAction()
    {
        $userD = new web_userData();
        $relaD = new lzh_user_relationData();
        $sql = "select * from lzh_user_relation where (f_uid = 72379 or s_uid = 72379 or t_uid = 72379) and f_eds = 0 order by uid desc";
        $sql = "select * from lzh_user_relation where rela_line like '58,1959,1952,7089,7780,8187,8261,%' order by uid desc";
        $arrList = $relaD::selectlist($sql);
        $tihuan = array(
            '58,1959,1952,7089,7780,8187,8261,'=>'58,1959,1952,7112,7089,7780,8261,',
            '2,1,1,1,1,0,1,'=>'2,1,1,1,1,1,1,'
        );
        foreach($arrList as $key => $arr)
        {
            $uid = $arr['uid'];
            $rela_line = $arr['rela_line'];
            $daili_line = $arr['daili_line'];
            $rela_line = strtr($rela_line,$tihuan);
            $daili_line = strtr($daili_line,$tihuan);
            $data = array(
                'rela_line'=>$rela_line,
                'daili_line'=>$daili_line
            );
            $whe = "uid='{$uid}'";
            $sql = $relaD::upsql($data,$whe,$relaD);
           // $relaD::execsql($sql);
            echo $key; echo ' '; echo $sql; echo "<hr>";
        }
    }

    public function upsqlAction()
    {
        DBData::setSqlDebug();
        $data = "a='b',b='ccc'";
        $data = array('title'=>'aa','b'=>null);
        $where = "";
        $act = '';
        $tf = DBData::uptable($data,$where,"test",$act);
        var_dump($tf);
    }

    //24日凌晨处理多返积分的人
    public function handelgobackAction()
    {
        exit();
        DBData::setSqlDebug();
        $uid = 8933;
        $type_num = 7;

        $uid = 18580;
        $type_num = 5;

        $uid = 21576;
        $type_num = 7;

        $uid = 28888;
        $type_num = 5;

        $uid = 59450;
        $type_num = 7;

        $uid = 61686;
        $type_num = 7;

        $uid = 67468;
        $type_num = 5;

        $uid = 76978;
        $type_num = 7;

        $uid = 77411;
        $type_num = 5;

        $uid = 77446;
        $type_num = 7;

        $uid = 77982;
        $type_num = 5;

        $uid = 85581;
        $type_num = 7;

        $uid = 100804;
        $type_num = 7;

        $uid = 101312;
        $type_num = 5;

        $uid = 114345;
        $type_num = 7;

        $uid = 122651;
        $type_num = 5;  

        $uid = 129988;
        $type_num = 7;

        $uid = 131155;
        $type_num = 7;

        $uid = 135264;
        $type_num = 5;

        $uid = 135831;
        $type_num = 7;

        $uid = 136116;
        $type_num = 5;

        $uid = 136264;
        $type_num = 7;

        $uid = 136762;
        $type_num = 5;

        $uid = 140034;
        $type_num = 5;

        $uid = 141963;
        $type_num = 7;

        $uid = 144996;
        $type_num = 5;

        $uid = 146315;
        $type_num = 7;

        $uid = 153758;
        $type_num = 5;

        $uid = 155368;
        $type_num = 5;

        $uid = 156174;
        $type_num = 5;




        DBData::printSql("handelgoback_{$uid}");
        $where = array('uid'=>$uid,'add_time > 1600876800','type_num'=>$type_num);
        $logD = new integrallogData();
        $arrList = $logD::RecordList("id,act_integral,integral,uid",$where,$logD->tablename);
        $cut_integral = 0;
        $limitdraw = 0;
        $_limit = 0.00;
        switch($type_num)
        {
            case 5:
                $_limit = 0.2;
            break;
            case 7:
                $_limit = 0.1;
            break;  
        }
        //开始处理
        foreach($arrList as $key=>$arr)
        {
            $i = $key +1;
            echo '['.$i.']';
            $id = $arr['id'];
            $act_integral = (int)$arr['act_integral'];
            $cut_integral = $cut_integral + $act_integral;
            $limitdraw = $limitdraw + $_limit;
            $uid = $arr['uid'];
            $sql = "delete from {$logD->tablename} where id = '{$id}'";
            $upnum = DBData::execsql($sql);

            if(!$upnum)
            {
                echo $i.'这里错了';
                exit();
            }
            
        }
        $limitdraw = round($limitdraw,3);
        $sql = "update web_user set limit_withdraw = limit_withdraw - {$limitdraw}, integral = integral - {$cut_integral} where id = '$uid'";
        $upnum = DBData::execsql($sql);
        if(!$upnum)
        {
            echo '最后更新错了';
            exit();
        }
        $sql = "update user_integral set integral = integral - {$cut_integral} where uid = '{$uid}'";
        $upnum = DBData::execsql($sql);
        if(!$upnum)
        {
            echo '最后积分更新错了';
            exit();
        }
    }

    public function jinjiAction()
    {
        exit();
        $uid = "8933,18580,21576,28888,59450,61686,67468,76978,77411,77446,77982";
        $integralD = new integralData();
        $userD = new web_userData();
        $sql = array();
        $sql[] = "update {$integralD->tablename} set integral = integral-51880 where uid = 8933";
        $sql[] = "update {$integralD->tablename} set integral = integral-103760 where uid = 18580";
        $sql[] = "update {$integralD->tablename} set integral = integral-25940 where uid = 21576";
        $sql[] = "update {$integralD->tablename} set integral = integral-51880 where uid = 28888";
        $sql[] = "update {$integralD->tablename} set integral = integral-25940 where uid = 59450";
        $sql[] = "update {$integralD->tablename} set integral = integral-25940 where uid = 61686";
        $sql[] = "update {$integralD->tablename} set integral = integral-51880 where uid = 67468";
        $sql[] = "update {$integralD->tablename} set integral = integral-25940 where uid = 76978";
        $sql[] = "update {$integralD->tablename} set integral = integral-51880 where uid = 77411";
        $sql[] = "update {$integralD->tablename} set integral = integral-25940 where uid = 77446";
        $sql[] = "update {$integralD->tablename} set integral = integral-51880 where uid = 77982";
        DBData::setSqlDebug();
        foreach($sql as $value)
        {
            echo $sql; echo "<br>";
        }
    }

    //检查8.31日之后没有返积分的情况
    public function checkgobackAction()
    {
        DBData::setSqlDebug();
        $userD = new web_userData();
        $integrallogD = new integrallogData();
        $integralD = new integralData();
        $relaD = new lzh_user_relationData();
        $dayrewardD = new dayrewardData();
        $pagesizes = 1000;
        // $sql = "select id,phone,daili,dengji,is_goback_zc,active_total,consume_time,consume_bz from web_user where is_goback_zc = 1 and active_total <21 and add_time >1598803200 limit 1000;";
        $fields = 'id,phone,daili,dengji,is_goback_zc,active_total,consume_time,consume_bz';
        $where = 'is_goback_zc = 1 and active_total <21 and add_time >1598803200';
        $userList = $userD::RecordList($fields,$where,$userD->tablename,"order by id asc",1,$pagesizes);
        if($userList)
        {
            foreach($userList as $userInfo)
            {
                $uid = $userInfo['id'];
                $relaInfo = $relaD::Record("f_uid,s_uid","uid='{$uid}'",$relaD->tablename);
                $f_uid = $relaInfo['f_uid'];
                $s_uid = $relaInfo['s_uid'];
                if($f_uid > 0)
                {
                    $total1 = $integrallogD::getCount("uid = {$f_uid} and   add_time > 1598803200 and type_num = 5 and from_act = 'zc:{$uid}'",$integrallogD->tablename);
                    if($total1 > 0)
                    {
                        $str = "给{$f_uid}返【5】积分了 <br>";
                        echo $str;
                        if($s_uid > 0)
                        {
                            $total2 = $integrallogD::getCount("uid = {$s_uid} and   add_time > 1598803200 and type_num = 7 and from_act = 'zc:{$uid}'",$integrallogD->tablename);
                            if($total2 > 0)
                            {
                                echo  "<br>给{$s_uid}返【7】积分了<br>";
                            }else
                            {
                                echo  "<br>没有给{$s_uid}返【7】积分了<br>";
                            }
                        } 
                    }else
                    {
                        echo"没有给{$f_uid}返【5】积分";
                        
                    }
                }else
                {
                    echo $uid.'没有上级<br>';
                }
                echo "<hr>";
                
            }
            
        }

    }

    public function absAction()
    {
        $D = new store_moneyData();
        $arrInfo = $D->getInfo(83186);
        $arrInfo = $D::Record("*","uid=1778","x_user_money");
        var_dump($arrInfo);
    }

    public function useAction()
    {
        $name = 'xiaochuan'; 
        $test = function ($names='test',$age=10) use ($name) { 
        //这里的name 不是用的传递的名字 而是 use 中
        echo $names;
        echo '<br>';
        echo $age;
        echo '<br>';
        echo $name;
        //花括号后面的 分号一定要加不然会报错
        };
        $test('xiaodou',20); 
    }
    public function jsonAction()
    {
        $a = '';
        $aArr = explode("||",$a);
        if(isset($aArr[0]))
        {
            echo '有';
        }else
        {
            echo '没有';
        }
        var_dump($aArr);
    }

}

?>
